package com.bwie.es;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * @author 军哥
 * @version 1.0
 * @description: TODO
 * @date 2025/4/29 11:21
 */

@Data
@Document(indexName = "es_user",shards = 1, replicas = 0)
public class EsUser implements Serializable {
    /**
     * 用户ID
     */
    @Field(type = FieldType.Keyword)
    @Id
    private Integer userId;

    /**
     * 登录账号
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String userName;

    /**
     * 登录密码 index=false, 不进行索引
     */
    @Field(type = FieldType.Keyword,index = false)
    private String userPass;

    /**
     * 真实姓名
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String nickName;

    /**
     * 手机号
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String userMobile;

    /**
     * 邮箱
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String userEmail;

    /**
     * 头像
     */
    @Field(type = FieldType.Keyword,index = false)
    private String userAvatar;

    /**
     * 注册时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8", shape = JsonFormat.Shape.STRING)
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 商户状态：0待审核1审核通过2审核驳回
     */
    @Field(type = FieldType.Integer)
    private Integer userStatus;

    /**
     * 审核说明
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String reason;


    private static final long serialVersionUID = 1L;
}
